/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Ron
 */
@Entity
@Table(name = "F_COMPTER")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FCompter.findAll", query = "SELECT f FROM FCompter f"),
    @NamedQuery(name = "FCompter.findByCRNum", query = "SELECT f FROM FCompter f WHERE f.cRNum = :cRNum"),
    @NamedQuery(name = "FCompter.findByCRType", query = "SELECT f FROM FCompter f WHERE f.cRType = :cRType"),
    @NamedQuery(name = "FCompter.findByCRIntitule", query = "SELECT f FROM FCompter f WHERE f.cRIntitule = :cRIntitule"),
    @NamedQuery(name = "FCompter.findByCRClassement", query = "SELECT f FROM FCompter f WHERE f.cRClassement = :cRClassement"),
    @NamedQuery(name = "FCompter.findByCRSaut", query = "SELECT f FROM FCompter f WHERE f.cRSaut = :cRSaut"),
    @NamedQuery(name = "FCompter.findByCbProt", query = "SELECT f FROM FCompter f WHERE f.cbProt = :cbProt"),
    @NamedQuery(name = "FCompter.findByCbMarq", query = "SELECT f FROM FCompter f WHERE f.cbMarq = :cbMarq"),
    @NamedQuery(name = "FCompter.findByCbCreateur", query = "SELECT f FROM FCompter f WHERE f.cbCreateur = :cbCreateur"),
    @NamedQuery(name = "FCompter.findByCbModification", query = "SELECT f FROM FCompter f WHERE f.cbModification = :cbModification"),
    @NamedQuery(name = "FCompter.findByCbReplication", query = "SELECT f FROM FCompter f WHERE f.cbReplication = :cbReplication"),
    @NamedQuery(name = "FCompter.findByCbFlag", query = "SELECT f FROM FCompter f WHERE f.cbFlag = :cbFlag")})
public class FCompter implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "CR_Num")
    private String cRNum;
    @Lob
    @Column(name = "cbCR_Num")
    private byte[] cbCRNum;
    @Column(name = "CR_Type")
    private Short cRType;
    @Column(name = "CR_Intitule")
    private String cRIntitule;
    @Column(name = "CR_Classement")
    private String cRClassement;
    @Lob
    @Column(name = "cbCR_Classement")
    private byte[] cbCRClassement;
    @Column(name = "CR_Saut")
    private Short cRSaut;
    @Column(name = "cbProt")
    private Short cbProt;
    @Id
    @Basic(optional = false)
    @Column(name = "cbMarq")
    private Integer cbMarq;
    @Column(name = "cbCreateur")
    private String cbCreateur;
    @Column(name = "cbModification")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cbModification;
    @Column(name = "cbReplication")
    private Integer cbReplication;
    @Column(name = "cbFlag")
    private Short cbFlag;
    @OneToMany(mappedBy = "cRNum")
    private Collection<FCompteg> fComptegCollection;

    public FCompter() {
    }

    public FCompter(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public FCompter(Integer cbMarq, String cRNum) {
        this.cbMarq = cbMarq;
        this.cRNum = cRNum;
    }

    public String getCRNum() {
        return cRNum;
    }

    public void setCRNum(String cRNum) {
        this.cRNum = cRNum;
    }

    public byte[] getCbCRNum() {
        return cbCRNum;
    }

    public void setCbCRNum(byte[] cbCRNum) {
        this.cbCRNum = cbCRNum;
    }

    public Short getCRType() {
        return cRType;
    }

    public void setCRType(Short cRType) {
        this.cRType = cRType;
    }

    public String getCRIntitule() {
        return cRIntitule;
    }

    public void setCRIntitule(String cRIntitule) {
        this.cRIntitule = cRIntitule;
    }

    public String getCRClassement() {
        return cRClassement;
    }

    public void setCRClassement(String cRClassement) {
        this.cRClassement = cRClassement;
    }

    public byte[] getCbCRClassement() {
        return cbCRClassement;
    }

    public void setCbCRClassement(byte[] cbCRClassement) {
        this.cbCRClassement = cbCRClassement;
    }

    public Short getCRSaut() {
        return cRSaut;
    }

    public void setCRSaut(Short cRSaut) {
        this.cRSaut = cRSaut;
    }

    public Short getCbProt() {
        return cbProt;
    }

    public void setCbProt(Short cbProt) {
        this.cbProt = cbProt;
    }

    public Integer getCbMarq() {
        return cbMarq;
    }

    public void setCbMarq(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public String getCbCreateur() {
        return cbCreateur;
    }

    public void setCbCreateur(String cbCreateur) {
        this.cbCreateur = cbCreateur;
    }

    public Date getCbModification() {
        return cbModification;
    }

    public void setCbModification(Date cbModification) {
        this.cbModification = cbModification;
    }

    public Integer getCbReplication() {
        return cbReplication;
    }

    public void setCbReplication(Integer cbReplication) {
        this.cbReplication = cbReplication;
    }

    public Short getCbFlag() {
        return cbFlag;
    }

    public void setCbFlag(Short cbFlag) {
        this.cbFlag = cbFlag;
    }

    @XmlTransient
    public Collection<FCompteg> getFComptegCollection() {
        return fComptegCollection;
    }

    public void setFComptegCollection(Collection<FCompteg> fComptegCollection) {
        this.fComptegCollection = fComptegCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cbMarq != null ? cbMarq.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FCompter)) {
            return false;
        }
        FCompter other = (FCompter) object;
        if ((this.cbMarq == null && other.cbMarq != null) || (this.cbMarq != null && !this.cbMarq.equals(other.cbMarq))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.FCompter[ cbMarq=" + cbMarq + " ]";
    }
    
}
